fix(python-client): async=true silently ignored on retain#709
Merged
nicoloboschi merged 3 commits intomainfrom Mar 26, 2026
Merged
fix(python-client): async=true silently ignored on retain#709nicoloboschi merged 3 commits intomainfrom
nicoloboschi merged 3 commits intomainfrom
Conversation
Add missing settings (retainMode, retainToolCalls, retainTags, retainMetadata, embedPackagePath, llmApiKeyEnv, agentName, and several recall options) that existed in code but not in docs. Restructure config tables with prose introductions, clearer descriptions, and consistent layout across both files.
Unused client-side cap — Hindsight server already controls result count via recallBudget and recallMaxTokens.
The hand-written client wrapper passed `async_=retain_async` to RetainRequest, but the generated Pydantic model uses `var_async` as the Python field name (with `alias="async"`). The `async_` kwarg didn't match either the field name or the alias, so Pydantic silently ignored it — every retain call ran synchronously regardless of the flag. This has been broken since the client was first introduced (6073ac4), not a regression. Also adds unit tests that verify the async field serializes correctly in the request JSON, preventing future regressions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RetainRequestwas constructed withasync_=retain_async, but the generated Pydantic model field isvar_async(alias"async"). Theasync_kwarg matched neither, so Pydantic silently dropped it — every retain call ran synchronously regardless of the flag.6073ac4f).Test plan
uv run pytest tests/test_retain_request_async.py)retain_async=Truenow returns immediately with an operation_id